import { Component,OnInit} from '@angular/core';
import { ActivatedRoute, Params} from '@angular/router';

@Component({
  selector: 'detail',
  template: `
    <h4>字符串</h4>
    <nz-breadcrumb nzSeparator=">">
      <nz-breadcrumb-item>
        首页
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        <a>产品列表</a>
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        应用
      </nz-breadcrumb-item>
    </nz-breadcrumb>
    <br>
    <h4>地址栏</h4>
    <nz-breadcrumb [nzSeparator]="iconTemplate">
      <nz-breadcrumb-item>
        首页
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        <a>产品列表</a> 
      </nz-breadcrumb-item>
      <nz-breadcrumb-item>
        应用
      </nz-breadcrumb-item>
    </nz-breadcrumb>
    <h4>产品ID</h4>
    <p>{{productId}}</p>
    <ng-template #iconTemplate><i class="anticon anticon-arrow-right"></i></ng-template>
  `,
  styles  : [
    `
      h4:first-child {
        margin-top: 0;
      }

      h4 {
        margin: 16px 0;
        font-size: 14px;
        line-height: 1;
        font-weight: normal;
      }
    `
  ]
})
export class DetailComponent implements OnInit{
  private productId:number;
  constructor(private routerIonfo:ActivatedRoute){}
  ngOnInit(){
    this.productId=this.routerIonfo.snapshot.queryParams["id"];
  }
}
